﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BonjourHotel.Model;

namespace BonjourHotel.Core.Hotels
{
    public class HotelFacade : FacadeBase<Hotel>
    {
        public Hotel GetHotel(int idHotel)
        {
            Hotel hotel = (from h in base.ObjectContext.HotelSet
                           where h.idHotel == idHotel
                           select h).FirstOrDefault();

            return hotel;
        }

        public List<Hotel> GetAllHotels()
        {
            var Hotels = from hotels in base.ObjectContext.HotelSet
                         orderby hotels.Name
                         select hotels;

            return Hotels.ToList();
        }
    }
}
